package com.tensquare.spit.controller;

import entity.Result;
import entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: tensquare-project
 * @description:
 **/
@ControllerAdvice
public class SpitHandlerException {

    @ExceptionHandler
    @ResponseBody
    public Result error(Exception e){
        return new Result(false, StatusCode.ERROR, "异常信息："+e.getMessage());
    }
}
